/**
 * @param {string} s
 * @return {number}
 */
var firstUniqChar = function(s) {
    let record = {}
    let index = -1
    for(let i=0;i<s.length;i++){
        if(!record.hasOwnProperty(s[i])){
            record[s[i]] = ""
        }
    }    
  
    return -1
};
console.log(firstUniqChar("loveleetcode"))
console.log(firstUniqChar("hghghileetcode"))  //5